class LibraryFunctions:
    @staticmethod
    def find_item(arr, condition_func):
        """查找符合条件的项目"""
        for item in arr:
            if condition_func(item):
                return item
        return None
    
    @staticmethod
    def update_item(arr, condition_func, update_func):
        """更新符合条件的项目"""
        for item in arr:
            if condition_func(item):
                update_func(item)
        return arr
    
    @staticmethod
    def filter_list(arr, condition_func):
        """过滤列表"""
        return [item for item in arr if condition_func(item)]
    
    @staticmethod
    def linear_search(arr, key, value):
        """线性搜索"""
        results = []
        for item in arr:
            if key in item:
                if isinstance(item[key], list):
                    if any(str(v).lower() == str(value).lower() for v in item[key]):
                        results.append(item)
                else:
                    if str(item[key]).lower() == str(value).lower():
                        results.append(item)
        return results